package fr.fort.lycee.spring.businesssImpl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fr.fort.lycee.spring.businesss.IBusinessEleve;
import fr.fort.lycee.spring.daoImpl.DaoEleveImpl;
import fr.fort.lycee.spring.entities.Eleve;

@Service("BusinessEleve")
@Transactional
public class BusinessEleveImpl implements IBusinessEleve {
@Autowired	
private DaoEleveImpl daoEleve;
	public Integer save(Eleve eleve) {
		Integer id=daoEleve.save(eleve);
		return id;
	}

	public void update(Eleve eleve) {
		daoEleve.update(eleve);
	}

	public void delete(Eleve eleve) {
		daoEleve.delete(eleve);
	}

	public Eleve findById(int id) {
		Eleve retour= daoEleve.findById(id);
		return retour;
	}

	@Override
	public List<Eleve> findAll() {
		List<Eleve> retour= new ArrayList<>();
		retour=daoEleve.findAll();
		return retour;
	}

}
